{% extends 'base.html' %}

{% block top_content %}
    <div class="gcb-cols">
      <div class="gcb-col-11 gcb-aside">

        {% include 'summary.html' %}

      </div>
    </div>
{% endblock %}

{% block main_content %}
    <div style="margin-top: 20px;" class="gcb-cols">
      <div class="gcb-col-1">
      </div>
      <div class="gcb-col-9">

        <h1 class="schedule-headers">
          {% trans %} Schedule {% endtrans %}
        </h1>
        <div class="gcb-main">
          <div style="width: 100%;" class="gcb-nav" id="gcb-nav-y">
            <ul>
              {% for unit in units %}
                {% if unit.now_available %}
                  {% if unit.type == 'A' %}
                    <li><p class="top_content">
                      <a href="assessment?name={{ unit.unit_id }}">{{ unit.title }}</a>
                    </p></li>
                  {% elif unit.type == 'U' %}
                    <li><p class="top_content">
                      <a href="unit?unit={{ unit.unit_id }}">
                        {{ gettext('Unit %(id)s - %(title)s', id=unit.unit_id, title=unit.title) }}
                      </a>
                    </p></li>
                  {% elif unit.type == 'O' %}
                    <li><p class="top_content">
                      <a href="{{ unit.unit_id }}"> {{ unit.title }} </a>
                    </p></li>
                  {% else %}
                    <li><p class="top_content">
                      Error: unit type not recognized.
                    </p></li>
                  {% endif %}
                {% else %}
                  {% if unit.type == 'A' %}
                    <li><p class="top_content">{{ unit.title }}</p></li>
                {% elif unit.type == 'U' %}
                    <li><p class="top_content">
                      {{ gettext('Unit %(id)s - %(title)s', id=unit.unit_id, title=unit.title) }}
                      <span style="padding-left: 20px; font-size: 12px; color: #5e94ff;">{{ unit.release_date }}</span>
                    </p></li>
                  {% elif unit.type == 'O' %}
                    <li><p class="top_content"> {{ unit.title }} </p></li>
                  {% else %}
                    <li><p class="top_content">
                      Error: unit type not recognized.
                    </p></li>
                  {% endif %}
                {% endif %}

              {% endfor %}
            </ul>
          </div>
        </div>
        
        {% if course_info.course.references_in_course == True %}      
        <h1 class="schedule-headers">
          {% trans %} References {% endtrans %}
        </h1>
        <div class="gcb-main">
          <div style="width: 100%;" class="gcb-nav" id="gcb-nav-y">
            <ul>
              {% for ref in references %}
                <li><p class="top_content">
                    <a href="{{ ref.link }}" target="_blank">
                        {{ gettext('%(id)s - %(title)s', id=ref.ref_id, title=ref.title) }}
                    </a>
                </p></li>
              {% endfor %}
            </ul>
          </div>
        </div>
        {% endif %}
        
      </div>
    </div>
{% endblock %}
